package net.htjs.juc.thread;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadPriority {

    public static void main(String[] args) {
        Runnable task1 = () ->{
            int count = 0;
            for (;;) {
                log.info("--------1>{}", count++);
            }
        };
        Runnable task2 = () ->{
            int count = 0;
            for (;;) {
                log.info("--------2>{}", count++);
            }
        };
        Thread thread1 = new Thread(task1, "Thread-1");
        Thread thread2 = new Thread(task2, "Thread-2");
        thread1.setPriority(Thread.MAX_PRIORITY);
        thread1.start();
        thread2.setPriority(Thread.NORM_PRIORITY);
        thread2.start();

    }


}
